<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Role extends \Encore\Admin\Auth\Database\Role
{
    //
    public function business()
    {
        return $this->hasOne(Business::class, 'role_id');
    }

    public static function selectBusinessRoleOptions()
    {
        return DB::table('admin_roles')->where('type','=','业务类角色')->pluck('name as text','id');
    }

}
